<!-- <template>
    <div id="app">
        <div class="container">
            <div class="body">
                <div class="b-left">
                    <div class="top">
                        <div class="t-left">院部新闻</div>
                        <div class="t-right">查看更多</div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                        <div class="right_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                        <div class="right_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                        <div class="right_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                        <div class="right_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                    </div>
                </div>
                <div class="b-left1">
                    <div class="top">
                        <div class="t-left">校企合作</div>
                        <div class="t-right">查看更多</div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                        <div class="right_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                        <div class="right_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                        <div class="right_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                        <div class="right_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                    </div>
                </div>
                <div class="b-center">
                    <img src="../../assets/more.png" alt="">
                </div>
                <div class="b-right">
                    <div class="item">
                        <div class="left_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                        <div class="right_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                        <div class="right_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                        <div class="right_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                    </div>
                    <div class="item">
                        <div class="left_">
                            <p>中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营</p>
                        </div>
                        <div class="right_">
                            <div class="day">28</div>
                            <div class="year">2019-01</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template> -->

<template>
    <div id="app">
        <div class="container">
            <div class="body">
                <div class="b-left">
                    <div class="top">
                        <div class="t-left">院部新闻</div>
                        <div class="t-right">查看更多</div>
                    </div>
                    <div v-for="(newsItem, index) in newsItems" :key="index" class="item">
                        <div class="left_">
                            <div class="day">{{ newsItem.day }}</div>
                            <div class="year">{{ newsItem.year }}</div>
                        </div>
                        <div class="right_">
                            <p>{{ newsItem.content }}</p>
                        </div>
                    </div>
                </div>
                <div class="b-left1">
                    <div class="top">
                        <div class="t-left">院部新闻</div>
                        <div class="t-right">查看更多</div>
                    </div>
                    <div v-for="(newsItem, index) in newsItems" :key="index" class="item">
                        <div class="left_">
                            <div class="day">{{ newsItem.day }}</div>
                            <div class="year">{{ newsItem.year }}</div>
                        </div>
                        <div class="right_">
                            <p>{{ newsItem.content }}</p>
                        </div>
                    </div>
                </div>
                <!-- b-center 和 b-right 部分也可以类似处理 -->
                <div class="b-center">
                    <img src="../../assets/more.png" alt="">
                </div>
                <div class="b-right">
                    <div v-for="(newsItem, index) in newsItems" :key="index" class="item">
                        <div class="left_">
                            <p>{{ newsItem.content }}</p>
                        </div>
                        <div class="right_">
                            <div class="day">{{ newsItem.day }}</div>
                            <div class="year">{{ newsItem.year }}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            newsItems: [
                { day: '28', year: '2019-01', content: '中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营' },
                { day: '28', year: '2019-01', content: '中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营' },
                { day: '28', year: '2019-01', content: '中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营' },
                { day: '28', year: '2019-01', content: '中餐学院2022级新生军训圆满闭营，中餐学院2022级新生军训圆满闭营' },
                // 重复添加更多对象以填充数据
            ],
        };
    },
};
</script>


<style scoped lang="scss">
#app {
    background-color: #f9f9f9;

    .container {
        width: 80%;
        margin: 0 auto;
        @media (max-width: 475px) {
                            width: 90%;
                        }
        .body {
            width: 100%;
            display: flex;
            align-items: center;
            flex-wrap: wrap;

            .b-left {
                display: flex;
                flex-wrap: wrap;
                width: 40%;

                @media (max-width: 475px) {
                    width: 100%;
                }

                .top {
                    display: none;
                    margin: 20px 0;
                    width: 100%;
                    height: 40px;

                    @media (max-width: 475px) {
                        display: flex;
                    justify-content: space-between;
                    }

                    .t-left {
                        width: 10%;
                        color: #4587c1;
                        font-weight: 500;
                        font-size: 24px;
                        line-height: 40px;

                        @media (max-width: 475px) {
                            width: 30%;
                        }
                    }

                    .t-right {
                        width: 10%;
                        text-align: center;
                        line-height: 40px;

                        @media (max-width: 475px) {
                            width: 30%;
                        }
                    }
                }

                .item {
                    margin: 10px 0;
                    width: 100%;
                    display: flex;

                    .left_ {
                        padding: 10px 0;
                        text-align: center;
                        color: #fff;
                        width: 12%;
                        background-color: #005bac;
                        @media (max-width: 475px) {
                            width: 20%;
                        }
                        .day {
                            font-size: 28px;
                            width: 100%;
                        }

                        .year {
                            width: 100%;
                            font-size: 12px;
                        }
                    }

                    .right_ {
                        padding: 15px;
                        width: 82%;
                        background-color: #fff;
                        @media (max-width: 475px) {
                            width: 80%;
                        }
                    }
                }
            }
            .b-left1 {
                display: none;
                flex-wrap: wrap;
                width: 40%;

                @media (max-width: 475px) {
                    display: flex;
                    width: 100%;
                }

                .top {
                    display: none;
                    margin: 20px 0;
                    width: 100%;
                    height: 40px;

                    @media (max-width: 475px) {
                        display: flex;
                    justify-content: space-between;
                    }

                    .t-left {
                        width: 10%;
                        color: #4587c1;
                        font-weight: 500;
                        font-size: 24px;
                        line-height: 40px;

                        @media (max-width: 475px) {
                            width: 30%;
                        }
                    }

                    .t-right {
                        width: 10%;
                        text-align: center;
                        line-height: 40px;

                        @media (max-width: 475px) {
                            width: 30%;
                        }
                    }
                }

                .item {
                    margin: 10px 0;
                    width: 100%;
                    display: flex;

                    .left_ {
                        padding: 10px 0;
                        text-align: center;
                        color: #fff;
                        width: 12%;
                        background-color: #005bac;
                        @media (max-width: 475px) {
                            width: 20%;
                        }
                        .day {
                            font-size: 28px;
                            width: 100%;
                        }

                        .year {
                            width: 100%;
                            font-size: 12px;
                        }
                    }

                    .right_ {
                        padding: 15px;
                        width: 82%;
                        background-color: #fff;
                        @media (max-width: 475px) {
                            width: 80%;
                        }
                    }
                }
            }
            .b-center {
                @media (max-width: 475px) {
                    display: none;
                }

                width: 20%;

                img {
                    width: 100%;
                }
            }

            .b-right {
                display: flex;
                flex-wrap: wrap;
                width: 40%;
                @media (max-width: 475px) {
                    display: none;
                }
                .item {
                    margin: 10px 0;
                    width: 100%;
                    display: flex;
                    flex-wrap: wrap;

                    .left_ {
                        padding: 15px;
                        width: 82%;
                        background-color: #fff;
                    }

                    .right_ {
                        padding: 10px 0;
                        text-align: center;
                        color: #fff;
                        width: 12%;
                        background-color: #005bac;

                        .day {
                            font-size: 28px;
                            width: 100%;
                        }

                        .year {
                            width: 100%;
                            font-size: 12px;
                        }
                    }
                }
            }
        }
    }
}
</style>